#！/bin/bash

BRANCH=$1

case $1 in
	master )
	git checkout "master"
		;;
	paysdk-1.6.3 )
	git checkout "paysdk-1.6.3"
		;;
	paysdk-1.6.3.1 )
	git checkout "paysdk-1.6.3.1"
		;;
	paysdk-1.6.3.2 )
	git checkout "paysdk-1.6.3.2"
		;;
	paysdk-1.6.3.3 )
	git checkout "paysdk-1.6.3.3"
		;;
	* )
	git checkout "master"
		;;
esac

if [[ $? == 0 ]]; then
	echo "切换成功"
else
	echo "切换失败"
	exit 
fi

git branch

git pull

FILEPATH="gitTest/gitTest/publicCFG.h"

sed -i -e 's/^#ifdef  DEBUG/#if (1)/' ${FILEPATH}

if [[ $2 = 1 ]]; then
	sed -i -e 's/^#if ([01])/#if (1)/' ${FILEPATH}
elif [[ $2 = 0 ]]; then
	sed -i -e 's/^#if ([01])/#if (0)/' ${FILEPATH}
else
	echo "参数非法"
fi

